//测试-静态栈
//编译：g++ TestStaticStack.cpp ../../*/*/StaticStack.hpp ../../*/ExceptionDefinition.hpp -o test
#ifndef __TESTSTATICSTACK__CPP
#define __TESTSTATICSTACK__CPP

#include<iostream>
#include"../../DataStructure/Stack/StaticStack.hpp"
#include"../../DataStructure/ExceptionDefinition.hpp"

using namespace std;
using namespace NgSiuKei;

int main(void) {
    cout << "初始化" << endl;
    StaticStack<int> stack;
    stack.print();

    try {
        cout << "入栈：0-5五个数字" << endl;
        for(int i=0; i<5; ++i) {
            stack.push(i);
            stack.print();
        }

        cout << "依次出栈" << endl;
        while(!stack.isEmpty()) {
            stack.pop();
            stack.print();
        }

        cout << "测试clean函数" << endl;
        for(int i=0; i<5; ++i) {
            stack.push(i);
        }
        stack.print();
        stack.clear();
        stack.print();
    }
    catch(Exception &e) {
        printException(e);
    }

    return 0;
}

#endif